import { lazy } from "react";
import {createBrowserRouter} from 'react-router-dom'
import{Navigate} from 'react-router-dom'
import Zhu from '../page/Zhu/Index'
import Login from '../page/Login/Index'
import Error from "../page/404/Error";

import Home from '../page/Home/Index'
import List from '../page/List/Index'
import Order from '../page/Order/Index'
import Wen from '../page/Wen/Index'
import {
  DesktopOutlined,
  FileOutlined,
  PieChartOutlined,
  TeamOutlined,
  UserOutlined,
} from '@ant-design/icons';

export const menu_router=[
    {
        path:"/zhu/home",
        element:<Home></Home>,
        title:"首页",
        icon:<DesktopOutlined></DesktopOutlined>
    },{
        path:"/zhu/list",
        element:<List></List>,
        title:"列表",
          icon:<FileOutlined></FileOutlined>,
        children:[
            {
                path:"/zhu/list/order",
                element:<Order></Order>,
                title:"三级",
                 icon:<PieChartOutlined></PieChartOutlined>,
            }
        ]
    },{
        path:"/zhu/wen",
        element:<Wen></Wen>,
        title:"文章系统",
         icon:<TeamOutlined></TeamOutlined>,
    }
]

const routes=createBrowserRouter([
    {
        path:"/",
        element:<Navigate to={'/zhu'}></Navigate>
    },
    {
        path:"/zhu",
        element:<Zhu></Zhu>,
        children:menu_router
    },
    {
        path:'/login',
        element:<Login></Login>
    },
    {
        path:"*",
        element:<Error></Error>
    }
])

export default routes